package com.ly.talent.service.impl;

import java.util.List;
import com.ly.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ly.talent.mapper.TalentSpecialtyMapper;
import com.ly.talent.domain.TalentSpecialty;
import com.ly.talent.service.ITalentSpecialtyService;

/**
 * 学科信息Service业务层处理
 * 
 * @author sfli
 * @date 2021-03-02
 */
@Service
public class TalentSpecialtyServiceImpl implements ITalentSpecialtyService 
{
    @Autowired
    private TalentSpecialtyMapper talentSpecialtyMapper;

    /**
     * 查询学科信息
     * 
     * @param id 学科信息ID
     * @return 学科信息
     */
    @Override
    public TalentSpecialty selectTalentSpecialtyById(Long id)
    {
        return talentSpecialtyMapper.selectTalentSpecialtyById(id);
    }

    /**
     * 查询学科信息列表
     * 
     * @param talentSpecialty 学科信息
     * @return 学科信息
     */
    @Override
    public List<TalentSpecialty> selectTalentSpecialtyList(TalentSpecialty talentSpecialty)
    {
        return talentSpecialtyMapper.selectTalentSpecialtyList(talentSpecialty);
    }

    /**
     * 新增学科信息
     * 
     * @param talentSpecialty 学科信息
     * @return 结果
     */
    @Override
    public int insertTalentSpecialty(TalentSpecialty talentSpecialty)
    {
        talentSpecialty.setCreateTime(DateUtils.getNowDate());
        return talentSpecialtyMapper.insertTalentSpecialty(talentSpecialty);
    }

    /**
     * 修改学科信息
     * 
     * @param talentSpecialty 学科信息
     * @return 结果
     */
    @Override
    public int updateTalentSpecialty(TalentSpecialty talentSpecialty)
    {
        talentSpecialty.setUpdateTime(DateUtils.getNowDate());
        return talentSpecialtyMapper.updateTalentSpecialty(talentSpecialty);
    }

    /**
     * 批量删除学科信息
     * 
     * @param ids 需要删除的学科信息ID
     * @return 结果
     */
    @Override
    public int deleteTalentSpecialtyByIds(Long[] ids)
    {
        return talentSpecialtyMapper.deleteTalentSpecialtyByIds(ids);
    }

    /**
     * 删除学科信息信息
     * 
     * @param id 学科信息ID
     * @return 结果
     */
    @Override
    public int deleteTalentSpecialtyById(Long id)
    {
        return talentSpecialtyMapper.deleteTalentSpecialtyById(id);
    }
}
